﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KNXObjects.Types
{
    public class StepDirType : IEquatable<StepDirType>
    {
        public int m_Direction;
        public int Direction { get { return m_Direction;}
            set {
                if (value < 0 || value > 1)
                    throw new ApplicationException("Invalid direction (must be equal to 0 or 1) : " + value);

                m_Direction = value;
            }
        }

        private int m_StepCode;
        public int StepCode
        {
            get { return m_StepCode; }
            set { 
                if (value < 1 || value > 7)
                    throw new ApplicationException("Invalid step (must be between 1 and 7. Val : " + value);

                m_StepCode = value;
            }
        }

        #region IEquatable<StepDirType> Members

        public bool Equals(StepDirType other)
        {
            return Direction == other.Direction && StepCode == other.StepCode;
        }

        #endregion
    }
}
